package vesion2.tool;

public class Timer {
   private  volatile boolean isOver=true;

   public  void Start(int interval){
       if(interval<0)
           return;
       if(isOver)
       new Thread(()->{
           isOver=false;
           try {
               Thread.sleep(interval);
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
           isOver=true;
       }).start();
   }

   public  boolean  isOver(){
       return isOver;
   }
}
